package com.ymatou.iapi.couponactivity.service;

import org.json.JSONObject;

import com.ymatou.iapi.couponactivity.parameter.UserReceiveList;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*获取用户领取失败的列表接口Call
*FreeMaker Template自动生成代码
*/
public class GetUserReceiveListCall extends YmatouBaseCall{
	private static String opurl ="api/Manager/GetUserReceiveList";
	
	public GetUserReceiveListCall() {
		super(EnvSetup.getSystemUrl("couponactivity"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	

	/**
	 * 获取Code
	 * 
	 * @return
	 */
	public String getCode() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("StatusCode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}

	/**
	 * 获取Message
	 * 
	 * @return
	 */
	public String getMessage() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("Message");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}

	/**
	 * 获取Data
	 * 
	 * @return
	 */
	public String getData() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("Data");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}
	
	public UserReceiveList getUserReceiveList()
	{
		UserReceiveList data = null;
        try {
            data = (UserReceiveList) FormatUtil.GSONToObject(getData(), UserReceiveList.class);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return data;
	}
}